package com.farm.device.service.impl;

import com.farm.device.dao.DeviceIndexMapper;
import com.farm.device.pojo.DeviceIndex;
import com.farm.device.service.DeviceIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;
import java.util.Map;
@Service
@Transactional
public class DeviceIndexServiceImpl implements DeviceIndexService {

    @Autowired
    private DeviceIndexMapper deviceIndexMapper;

    @Override
    public List<DeviceIndex> findByDid( Integer did) {

//        Example example=new Example(DeviceIndex.class);
//        Example.Criteria criteria = example.createCriteria();
//
//
//            criteria.andEqualTo("did",did);

//        List<DeviceIndex> deviceIndexList = deviceIndexMapper.selectByExample(example);

        List <DeviceIndex> select = deviceIndexMapper.select(new DeviceIndex(did));
//        return deviceIndexList;

        return select;
    }
}
